<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <script src="./js/vue.js"></script>
</head>

<body>
  <div id="app">{{msg}}
    <anchored-heading :level="1">Hello world!</anchored-heading>
    <anchored-heading :level="2">Hello world!</anchored-heading>
    <anchored-heading :level="3">Hello world!</anchored-heading>
    <anchored-heading :level="4">Hello world!</anchored-heading>
    <anchored-heading :level="5">Hello world!</anchored-heading>
    <anchored-heading :level="6">Hello world!</anchored-heading>
  </div>

  <script>
    Vue.component('anchored-heading', {
      template: `#components-header`,
      render: function (h) {
        return h('div', {
          "class": ['class1', 'class2'],
          style: {
            color: 'red',
          },
          attrs: {
            id: '1212'
          },
        }, [
          h('h1', 'Hello Vue!'),
          h('p', '开始学习Vue!')
        ])
      },
      props: {
        level: {
          type: Number,
          required: true,
          default: 1
        }
      }
    })
    var vm = new Vue({
      el: '#app',
      data: {
        msg: '1212'
      }
    });
  </script>
</body>

</html>